package com.hiultra.archive.service.impl;

import com.hiultra.archive.domain.ArcEnvironmentSet;
import com.hiultra.archive.mapper.ArcEnvironmentSetMapper;
import com.hiultra.archive.service.IArcEnvironmentSetService;
import com.hiultra.common.utils.DateUtils;
import com.hiultra.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 阈值设置Service业务层处理
 * 
 * @author ls
 * @date 2022-07-28
 */
@Service
public class ArcEnvironmentSetServiceImpl implements IArcEnvironmentSetService
{
    @Autowired
    private ArcEnvironmentSetMapper arcEnvironmentSetMapper;

    /**
     * 查询阈值设置
     * 
     * @param setId 阈值设置主键
     * @return 阈值设置
     */
    @Override
    public ArcEnvironmentSet selectArcEnvironmentSetBySetId(Long setId)
    {
        return arcEnvironmentSetMapper.selectArcEnvironmentSetBySetId(setId);
    }

    /**
     * 查询阈值设置列表
     * 
     * @param arcEnvironmentSet 阈值设置
     * @return 阈值设置
     */
    @Override
    public List<ArcEnvironmentSet> selectArcEnvironmentSetList(ArcEnvironmentSet arcEnvironmentSet)
    {
        return arcEnvironmentSetMapper.selectArcEnvironmentSetList(arcEnvironmentSet);
    }

    /**
     * 新增阈值设置
     * 
     * @param arcEnvironmentSet 阈值设置
     * @return 结果
     */
    @Override
    public int insertArcEnvironmentSet(ArcEnvironmentSet arcEnvironmentSet)
    {
        arcEnvironmentSet.setOperatorId(SecurityUtils.getUserId());
        arcEnvironmentSet.setUpdatetime(DateUtils.getNowDate());
        return arcEnvironmentSetMapper.insertArcEnvironmentSet(arcEnvironmentSet);
    }

    /**
     * 修改阈值设置
     * 
     * @param arcEnvironmentSet 阈值设置
     * @return 结果
     */
    @Override
    public int updateArcEnvironmentSet(ArcEnvironmentSet arcEnvironmentSet)
    {
        arcEnvironmentSet.setUpdatetime(DateUtils.getNowDate());
        return arcEnvironmentSetMapper.updateArcEnvironmentSet(arcEnvironmentSet);
    }

    /**
     * 批量删除阈值设置
     * 
     * @param setIds 需要删除的阈值设置主键
     * @return 结果
     */
    @Override
    public int deleteArcEnvironmentSetBySetIds(Long[] setIds)
    {
        return arcEnvironmentSetMapper.deleteArcEnvironmentSetBySetIds(setIds);
    }

    /**
     * 删除阈值设置信息
     * 
     * @param setId 阈值设置主键
     * @return 结果
     */
    @Override
    public int deleteArcEnvironmentSetBySetId(Long setId)
    {
        return arcEnvironmentSetMapper.deleteArcEnvironmentSetBySetId(setId);
    }
}
